{% extends 'admin/master.html' %}

{% block body %}

<div class="container">
    <div class="page-header">
        <h1>Task {{ task.id }}</h1>
    </div>

    <p><strong>Date :</strong> {{ task.created_at.strftime('%a, %d %b %Y %H:%M:%S') }}</p>

    {% for change in changes %}
    <div>
        <u>{{ change.cve.cve_id }} has changed</u>
        [<a href="/admin/changes/{{ change.id }}">{{ change.events|length }} {{ 'events' if change.events|length > 1
        else 'event' }}</a>]
        <ul>
            {% for event in change.events %}
            {% if event.type.code != 'new_cve' %}
            <li>{{ event }}</li>
            {% else %}
            <li>[NEW CVE] {{ event }}</li>
            {% endif %}
            {% endfor %}
        </ul>
    </div>
    {% endfor %}

    </div>
    {% endblock %}